<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Sidebar</span> <span class="htmlAttributeName"><span class="atSign">&#64;</span>ref</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">sidebar</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarContent</span><span class="htmlTagDelimiter">&gt;</span>
        <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarBrand</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">a</span> <span class="htmlAttributeName">href</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">#</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Blazorise Sidebar<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">a</span><span class="htmlTagDelimiter">&gt;</span>
        <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarBrand</span><span class="htmlTagDelimiter">&gt;</span>
        <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarNavigation</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLabel</span><span class="htmlTagDelimiter">&gt;</span>Main<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLabel</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">To</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">#</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Title</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Home</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Icon</span> <span class="htmlAttributeName">Name</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">IconName</span><span class="enumValue">.Home</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Margin</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Margin.Is3.FromRight</span><span class="quot">&quot;</span> <span class="htmlTagDelimiter">/&gt;</span>Home
                <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">Toggled</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">(isOpen)=&gt; mailSidebarSubItems.Toggle(isOpen)</span><span class="quot">&quot;</span> <span class="htmlAttributeName">IsShow</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Icon</span> <span class="htmlAttributeName">Name</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">IconName</span><span class="enumValue">.Mail</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Margin</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Margin.Is3.FromRight</span><span class="quot">&quot;</span> <span class="htmlTagDelimiter">/&gt;</span>Email
                <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarSubItem</span> <span class="htmlAttributeName"><span class="atSign">&#64;</span>ref</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">mailSidebarSubItems</span><span class="quot">&quot;</span> <span class="htmlAttributeName">IsShow</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                        <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">To</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">#email/inbox</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Inbox<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                        <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">To</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">#email/compose</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Compose Email<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="atSign">&#64;</span>* other subitems *<span class="atSign">&#64;</span>
                <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarSubItem</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">Toggled</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">(isOpen)=&gt; appsSidebarSubItems.Toggle(isOpen)</span><span class="quot">&quot;</span> <span class="htmlAttributeName">IsShow</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Icon</span> <span class="htmlAttributeName">Name</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">IconName</span><span class="enumValue">.Smartphone</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Margin</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Margin.Is3.FromRight</span><span class="quot">&quot;</span> <span class="htmlTagDelimiter">/&gt;</span>Apps
                <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarSubItem</span> <span class="htmlAttributeName"><span class="atSign">&#64;</span>ref</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">appsSidebarSubItems</span><span class="quot">&quot;</span> <span class="htmlAttributeName">IsShow</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">true</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                        <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SidebarLink</span> <span class="htmlAttributeName">To</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">#apps/todo</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Todo List<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarLink</span><span class="htmlTagDelimiter">&gt;</span>
                    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
                <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarSubItem</span><span class="htmlTagDelimiter">&gt;</span>
            <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarItem</span><span class="htmlTagDelimiter">&gt;</span>
        <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarNavigation</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">SidebarContent</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Sidebar</span><span class="htmlTagDelimiter">&gt;</span>
</pre></div>
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code{
    Sidebar sidebar;
    SidebarSubItem mailSidebarSubItems;
    SidebarSubItem appsSidebarSubItems;

    <span class="keyword">void</span> ToggleSidebar()
    {
        sidebar.Toggle();
    }
}
</pre></div>
</div>
